package com.wyz.saas.app.set.ui

import android.graphics.Bitmap
import com.atom.annotation.Impl
import com.wyz.saas.api.set.AppSetDescriptor
import com.wyz.saas.api.set.AppSetter
import com.wyz.saas.app.R
import com.wyz.saas.common.set.AbstractAppSetDescriptorInt

@Impl(api = AppSetDescriptor::class)
class AppSetAuthAgeDescirptor : AbstractAppSetDescriptorInt() {

    companion object {
        const val NAME = "mine_age"
    }

    override fun max(): Int {
        return 100
    }

    override fun min(): Int {
        return 0
    }

    override fun default(): Int {
        return 26
    }

    override fun get(): Int? {
        return mApiContext.getImpl(AppSetter::class.java)?.get(NAME)?.toInt()
    }

    override fun put(t: Int) {
        mApiContext.getImpl(AppSetter::class.java)?.set(NAME , t)
    }

    override fun getTip(): String {
       return "名字"
    }

    override fun getGroup(): String {
        return "MINE"
    }

    override fun getIcon(): Bitmap? {
       return mApiContext.getBitmap(R.mipmap.icon_mine)
    }

    override fun getLabel(): String {
       return "我的年龄"
    }
}